package com.sk.cardeal.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sk.cardeal.R;
import com.sk.cardeal.entity.KindList;

import java.util.List;

/**
 * Created by sk on 2018/4/12.
 */

public class PartsKindAdapter extends BaseQuickAdapter<KindList.ResultListBean,BaseViewHolder> {

    public PartsKindAdapter(int layoutResId, @Nullable List<KindList.ResultListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, KindList.ResultListBean item) {

        if(item.isCheck()){
            helper.setChecked(R.id.kind_check,true);
        }else {
            helper.setChecked(R.id.kind_check,false);
        }

        helper.setText(R.id.kind_check,item.getPartsName())
        .addOnClickListener(R.id.kind_check);
    }
}
